<template>
    <div id="content">
        <ul class="mui-table-view">
            <li v-for="(news,key) in newsList.message" :key="key" class="mui-table-view-cell mui-media">
                <router-link v-bind="{to:'/newsinfo/'+news.id}" class="">
                    <img class="mui-media-object mui-pull-left" :src="news.img_url">
                    <div class="mui-media-body">
                        {{news.title}}
                        <p class="mui-ellipsis">{{news.zhaiyao}}</p>
                        <div>
                            <span>时间:{{news.add_time}}</span>
                            <span>点击:{{news.click}}</span>
                        </div>
                    </div>
                </router-link>
            </li>

        </ul>
    </div>
</template>
<style scoped>
</style>
<script>
    export default{
        data(){
            return {
                newsList:{}
            }
        },
        methods:{
            geinews:function () {
                let url='http://182.254.146.100:8899/api/getnewslist'
                this.$http.get(url)
                    .then((data)=>{
                    this.newsList=data.body
                    })
            }
        },
        created(){
            this.geinews()
        }


    }
</script>
